home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / MONITOR / SWEARS10.ARJ / SWEARS.DOC < prev    next >
Text File  |  1991-06-25  |  13KB  |  164 lines

  1. Help!
  2.   Here's the first release beta version of my "swears" curses-look-alike lib
  3. for the pc environment.  BUT I need help.  This package is far from complete,
  4. so why don't you try it with your Quick C compiler, and e-mail me some
  5. suggestions...
  6.   Thanks!
  7. Jim Dunn, dunn@andrews.edu
  8.  
  9.   /**************************************************************************\
  10.   *                                  Swears                                  *
  11.   *                 by Professor Von Ignatius Pseudo, E.K.C.P.               *
  12.   *                                                                          *
  13.   *  Swears is a C add-on library giving you various windowing and utility   *
  14.   *  functions provided in unix curses.  There's no termcap, but there IS    *
  15.   *  direct video screen writes with TRUE refresh functions!  Use at your    *
  16.   *  own risk...                                                             *
  17.   *                                                                          *
  18.   *  This implementation of Swears is for the Microsoft Quick C language on  *
  19.   *  the IBM PC compatibles, based on the unix curses package.  You'll need  *
  20.   *  the two files:  SWEARS.H and SWEARS.LIB (renamed from SWEARS_x.LIB) and *
  21.   *  these two files may be renamed to CURSES.H and CURSES.LIB if you like.  *
  22.   *  As usual, if you are having any problems, you might try a vacation...   *
  23.   *                                                                          *
  24.   *  Swears is TOTALLY, COMPLETELY, ENTIRELY free!  You may use the Swears   *
  25.   *  library to create any program, either free or for sale, without paying  *
  26.   *  any royalty fees.  You don't even have to display any sort of Swears    *
  27.   *  logo, copyright or info about Swears in your program, at all.  Swears   *
  28.   *  is IdeaRighted (I) 1990 by ACME F.S.P.F.  Please see attached document. *
  29.   *                                                                          *
  30.   *               Yes, this was another TEAM ATTACK project...               *
  31.   *    "I tried to get the team to work on it, but they attacked me !?!"     *
  32.   *                 -Professor Von Ignatius Pseudo, E.K.C.P.                 *
  33.   \***************************************************************************/
  34.  
  35.   ┌──────────────────────────────────────────────────────────────────────────┐
  36.   │                                                                          │
  37.   │  NAME                                                                    │
  38.   │                                                                          │
  39.   │       swears - screen functions to emulate the unix curses library.      │
  40.   │                                                                          │
  41.   │  SYNTAX                                                                  │
  42.   │                                                                          │
  43.   │       #include <swears.h>                                                │
  44.   │                                                                          │
  45.   │       This will automatically include the stdio.h header file.           │
  46.   │                                                                          │
  47.   │  DESCRIPTION                                                             │
  48.   │                                                                          │
  49.   │       This version of curses for the pc is based upon a direct           │
  50.   │       screen write algorithm.  No termcap is used, just arrays and       │
  51.   │       video memory writes.  The original screen is saved, an image       │
  52.   │       of the screen is built in memory and that memory is written        │
  53.   │       to the screen each time the REFRESH() function is called.          │
  54.   │       The INITSCR() function MUST be used before any other of the        │
  55.   │       functions, and you MUST end with ENDWIN() before exiting.          │
  56.   │                                                                          │
  57.   │  FUNCTIONS                                                               │
  58.   │                                                                          │
  59.   │       addch(ch)                add a character to stdscr                 │
  60.   │       addstr(str)              add a string to stdscr                    │
  61.   │                                                                          │
  62.   │       box(win,vert,hor)        draw a box around a window                │
  63.   │                                                                          │
  64.   │       cbreak()                 set cbreak mode                           │
  65.   │       clear()                  clear stdscr                              │
  66.   │       clearok(scr,boolf)       set clear flag for scr                    │
  67.   │       clrtobot()               clear to bottom on stdscr                 │
  68.   │       clrtoeol()               clear to end of line on stdscr            │
  69.   │                                                                          │
  70.   │       delch()                  delete a character                        │
  71.   │       deleteln()               delete a line                             │
  72.   │       delwin(win)              delete win                                │
  73.   │                                                                          │
  74.   │       echo()                   set echo mode                             │
  75.   │       endwin()                 end window modes                          │
  76.   │       erase()                  erase stdscr                              │
  77.   │                                                                          │
  78.   │       flushok(win,boolf)       set flush-on-refresh flag for win         │
  79.   │                                                                          │
  80.   │       getch()                  get a char through stdscr                 │
  81.   │       getcap(name)             get terminal capability name              │
  82.   │       getstr(str)              get a string through stdscr               │
  83.   │       gettmode()               get tty modes                             │
  84.   │       getyx(win,y,x)           get (y,x) co-ordinates                    │
  85.   │                                                                          │
  86.   │       inch()                   get char at current (y,x) co-ordinates    │
  87.   │       initscr()                initialize screens                        │
  88.   │       insch(c)                 insert a char                             │
  89.   │       insertln()               insert a line                             │
  90.   │                                                                          │
  91.   │       leaveok(win,boolf)       set leave flag for win                    │
  92.   │       longname(termbuf,name)   get long name from termbuf                │
  93.   │                                                                          │
  94.   │       move(y,x)                move to (y,x) on stdscr                   │
  95.   │       mvcur(lasty,lastx,newy,newx)                                       │
  96.   │                                actually move cursor                      │
  97.   │       newwin(lines,cols,begin_y,begin_x)                                 │
  98.   │                                create a new window                       │
  99.   │       nl()                     set newline mapping                       │
  100.   │       nocbreak()               unset cbreak mode                         │
  101.   │       noecho()                 unset echo mode                           │
  102.   │       nonl()                   unset newline mapping                     │
  103.   │       noraw()                  unset raw mode                            │
  104.   │                                                                          │
  105.   │       overlay(win1,win2)       overlay win1 on win2                      │
  106.   │       overwrite(win1,win2)     overwrite win1 on top of win2             │
  107.   │                                                                          │
  108.   │       printw(fmt,arg1,arg2,...)                                          │
  109.   │                                printf on stdscr                          │
  110.   │                                                                          │
  111.   │       raw()                    set raw mode                              │
  112.   │       refresh()                make current screen look like stdscr      │
  113.   │       resetty()                reset tty flags to stored value           │
  114.   │                                                                          │
  115.   │       savetty()                stored current tty flags                  │
  116.   │       scanw(fmt,arg1,arg2,...) scanf through stdscr                      │
  117.   │       scroll(win)              scroll win one line                       │
  118.   │       scrollok(win,boolf)      set scroll flag                           │
  119.   │       setterm(name)            set term variables for name               │
  120.   │       standend()               end standout mode                         │
  121.   │       standout()               start standout mode                       │
  122.   │       subwin(win,lines,cols,begin_y,begin_x)                             │
  123.   │                                create a subwindow                        │
  124.   │                                                                          │
  125.   │       touchline(win,y,sx,ex)   mark line y sx through ex as changed      │
  126.   │       touchoverlap(win1,win2)  mark overlap of win1 and win2 as changed  │
  127.   │       touchwin(win)            change all of win                         │
  128.   │                                                                          │
  129.   │       unctrl(ch)               printable version of ch                   │
  130.   │                                                                          │
  131.   │       waddch(win,ch)           add char to win                           │
  132.   │       waddstr(win,str)         add string to win                         │
  133.   │       wclear(win)              clear win                                 │
  134.   │       wclrtobot(win)           clear to bottom of win                    │
  135.   │       wclrtoeol(win)           clear to end of line on win               │
  136.   │       wdelch(win,c)            delete char from win                      │
  137.   │       wdeleteln(win)           delete line from win                      │
  138.   │       werase(win)              erase win                                 │
  139.   │       wgetch(win)              get a char through win                    │
  140.   │       wgetstr(win,str)         get a string through win                  │
  141.   │       winch(win)               get char at current (y,x) in win          │
  142.   │       winsch(win,c)            insert char into win                      │
  143.   │                                                                          │
  144.   │       winsertln(win)           insert line into win                      │
  145.   │       wmove(win,y,x)           set current (y,x) co-ordinates on win     │
  146.   │       wprintw(win,fmt,arg1,arg2,...)                                     │
  147.   │                                printf on win                             │
  148.   │       wrefresh(win)            make screen look like win                 │
  149.   │       wscanw(win,fmt,arg1,arg2,...)                                      │
  150.   │                                scanf through win                         │
  151.   │       wstandend(win)           end standout mode on win                  │
  152.   │       wstandout(win)           start standout mode on win                │
  153.   │                                                                          │
  154.   │  EXAMPLE                                                                 │
  155.   │                                                                          │
  156.   │       The following example shows how to compile a swears program.       │
  157.   │                                                                          │
  158.   │            qcl <files.c> SWEARS.LIB                                      │
  159.   │            cl  <files.c> SWEARS.LIB                                      │
  160.   │                                                                          │
  161.   │  EOF                                                                     │
  162.   │                                           by Jim Dunn, dunn@andrews.edu  │
  163.   └──────────────────────────────────────────────────────────────────────────┘
  164.